import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

import home from '@/views/home/home.vue'
import category from '@/views/category/category.vue'
import shopcart from '@/views/shopcart/shopcart.vue'
import user from '@/views/user/user.vue'

import productList from '@/views/product-list/product-list.vue'

import login from "@/views/login/login.vue"
import register from '@/views/register/register.vue'
const routes = [

    {
        path: '/',
        component: home,
        meta: {
            index: 1
        }
    }, {
        path: '/category',
        component: category,
        meta: {
            index: 1
        }
    }, {
        path: '/shopcart',
        component: shopcart,
        meta: {
            index: 1
        }
    }, {
        path: '/user',
        component: user,
        meta: {
            index: 1
        }
    }, {
        path: '/product-list',
        component: productList,
        meta: {
            index: 2
        }
    },
    {
        path: '/detail/:id',
        name: 'Detail',
        component: () =>
            import ('@/views/product-detail/product-detail.vue'),
        meta: {
            index: 3
        }
    },
    {
        path: '/login',
        component: login,
        meta: {
            index: 2
        }
    },
    {
        path: '/register',
        component: register
    }

];

const router = new VueRouter({
    routes,
});

export default router;